package com.bigdata.controller;

import com.bigdata.entity.pojo.Result;
import com.bigdata.service.CntService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author  王铭轩
 *  控制器：负责  连接点  相关业务处理（28、29）
 */
@RestController
@RequestMapping("/link")
public class ConnectionController {

    @Autowired
    private CntService cntService;

    /**
     * 28：获取连接点排名
     * @return
     */
    @GetMapping("/rank")
    Result<Object> getConnectionRanking(){
        return Result.success(this.cntService.getConnectionRanking());
    }

    /**
     * 29：获取连接点地理分布
     * @return
     */
    @GetMapping("/distribution")
    Result<Object> getCntDistribution(){
        return Result.success(this.cntService.getCntDistribution());
    }
}
